package ddemo.dao;

import ddemo.pojo.Cbooking;
import ddemo.pojo.Charger;
import ddemo.pojo.User;

import java.util.List;

public interface CbookingMapper {
    @Select("SELECT * FROM `booking`")
    public List<Cbooking> getAll();
    @Select("UPDATE  `booking` SET `userid` = #{userid},`usestatus` = #{usestatus} WHERE id = #{id} and time=#{time}")
    public int book(@Param("userid") Integer userid,@Param("usestatus")String usestatus,@Param("id")Integer id,@Param("time")String time);
    @Select("INSERT INTO `booking` (id,usestatus,time,chargerid,userid) values(#{id},#{usestatus},#{time},#{chargerid},#{userid})")
    public int addBook(@Param("id") Integer id,@Param("usestatus")String usestatus,@Param("chargerid")Integer chargerid,@Param("time")String time,@Param("userid") Integer userid);
    @Select("DELETE FROM `booking` WHERE id = #{id} and time = #{time}")
    public int deleteBook(@Param("id") Integer id,@Param("time") String time);
}
